package com.ojoin.ojoin.eb_spider.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.ojoin.trade.common.utils.CommonUtils;

public class AlipayCheckException implements Serializable {

	public AlipayCheckException(Long availableBalanceStartingValue,
			Long disableBalanceStartingValue) {
		this.availableBalanceStartingValue = availableBalanceStartingValue;
		this.disableBalanceStartingValue = disableBalanceStartingValue;
	}

	public AlipayCheckException() {

	}

	/*
	 * 登陆信息
	 */
	public static final String logIn_normal = "正常";

	public static final String logIn_exception = "失败";

	private String logIn;

	/*
	 * 绑卡信息
	 */
	private List<String> boundCard = new ArrayList<String>();

	/*
	 * 提款信息
	 */
	private List<String> withdrawDeposit = new ArrayList<String>();

	/**
	 * 余额支付
	 */

	private String balancePay;

	/**
	 * 无线支付
	 */

	private String wirelessPay;

	/**
	 * 关联账号异常问题
	 */
	private Set<String> relations = new HashSet<String>();;

	/**
	 * 系统错误
	 */
	private Map<String, Exception> exception = new HashMap<String, Exception>();

	private boolean isneed;

	private Date checkedStartTime;

	/**
	 * 欠款金额
	 */
	private Long amountInArrear;
	
	/**
	 * 天猫待结算金额
	 */
	private Float tmallUnpaySettleorder;
	
	/**
	 * 天猫待结算金额
	 */
	
	private String tmallUnpaySettleorderDetail;
	
	/**
	 * 菜鸟库存金额
	 */
	private Float caiNiaoSettleorder;
	
	/**
	 * 菜鸟库存明细
	 */
	private String caiNiaoSettleorderDetail;
	
	
	/**
	 * 欠款金额
	 */
	private String amountInArrearUrl;

	private Long availableBalanceStartingValue;

	private Long disableBalanceStartingValue;

	/**
	 * 可用余额
	 */
	private Long availableBalance;
	/**
	 * 不可用余额
	 */
	private Long disableBalance;

	public String getLogIn() {
		return logIn;
	}

	public void setLogIn(String logIn) {
		this.logIn = logIn;
	}

	public List<String> getBoundCard() {
		return boundCard;
	}

	public void setBoundCard(List<String> boundCard) {
		this.boundCard = boundCard;
	}

	public List<String> getWithdrawDeposit() {
		return withdrawDeposit;
	}

	public void setWithdrawDeposit(List<String> withdrawDeposit) {
		this.withdrawDeposit = withdrawDeposit;
	}

	public String getBalancePay() {
		return balancePay;
	}

	public void setBalancePay(String balancePay) {
		this.balancePay = balancePay;
	}

	public String getWirelessPay() {
		return wirelessPay;
	}

	public void setWirelessPay(String wirelessPay) {
		this.wirelessPay = wirelessPay;
	}

	public Map<String, Exception> getException() {
		return exception;
	}

	public void setException(Map<String, Exception> exception) {
		this.exception = exception;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((logIn == null) ? 0 : logIn.hashCode());
		result = prime * result
				+ ((wirelessPay == null) ? 0 : wirelessPay.hashCode());
		result = prime * result
				+ ((withdrawDeposit == null) ? 0 : withdrawDeposit.hashCode());
		result = prime * result
				+ ((boundCard == null) ? 0 : boundCard.hashCode());
		result = prime * result
				+ ((balancePay == null) ? 0 : balancePay.hashCode());
		result = prime * result
				+ ((relations == null) ? 0 : relations.hashCode());

		result = prime * result
				+ ((amountInArrear == null) ? 0 : amountInArrear.hashCode());

		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null) {
			return false;
		} else {
			if (obj instanceof AlipayCheckException) {
				AlipayCheckException c = (AlipayCheckException) obj;

				if (CommonUtils.isEqual(c.getLogIn(), this.getLogIn())
						&& CommonUtils.isEqual(c.getWirelessPay(),
								this.getWirelessPay())

						&& CommonUtils.isEqual(c.getWithdrawDeposit(),
								this.getWithdrawDeposit())

						&& CommonUtils.isEqual(c.getRelations(),
								this.getRelations())

						&& CommonUtils.isEqual(c.getBoundCard(),
								this.getBoundCard())

				) {
					return true;
				}

			}
		}
		return false;
	}

	public boolean contain(Object obj) {
		if (this == obj)
			return true;
		if (obj == null) {
			return true;
		} else {
			if (obj instanceof AlipayCheckException) {
				AlipayCheckException c = (AlipayCheckException) obj;

				if (
						
				c.getWithdrawDeposit().containsAll(this.getWithdrawDeposit())

				&& c.getRelations().containsAll(this.getRelations())

				&& c.getBoundCard().containsAll(this.getBoundCard())
				
				&& c.getException().keySet().containsAll(this.getException().keySet())

				) {
					return true;
				}

			}
		}
		return false;
	}

	public Set<String> getRelations() {
		return relations;
	}

	public void setRelations(Set<String> relations) {
		this.relations = relations;
	}

	public boolean isIsneed() {
		return isneed;
	}

	public void setIsneed(boolean isneed) {
		this.isneed = isneed;
	}

	public Date getCheckedStartTime() {
		return checkedStartTime;
	}

	public void setCheckedStartTime(Date checkedStartTime) {
		this.checkedStartTime = checkedStartTime;
	}

	/**
	 * 获取贷款额度
	 * 
	 * @return
	 */

	

	public String getAmountInArrearUrl() {
		return amountInArrearUrl;
	}

	public Long getAmountInArrear() {
		return amountInArrear;
	}

	public void setAmountInArrear(Long amountInArrear) {
		this.amountInArrear = amountInArrear;
	}

	public void setAmountInArrearUrl(String amountInArrearUrl) {
		this.amountInArrearUrl = amountInArrearUrl;
	}

	public Long getAvailableBalanceStartingValue() {
		return availableBalanceStartingValue;
	}

	public void setAvailableBalanceStartingValue(
			Long availableBalanceStartingValue) {
		this.availableBalanceStartingValue = availableBalanceStartingValue;
	}

	public long getDisableBalanceStartingValue() {
		return disableBalanceStartingValue;
	}

	public void setDisableBalanceStartingValue(Long disableBalanceStartingValue) {
		this.disableBalanceStartingValue = disableBalanceStartingValue;
	}

	public Long getAvailableBalance() {
		return availableBalance;
	}

	public void setAvailableBalance(Long availableBalance) {
		this.availableBalance = availableBalance;
	}

	public Long getDisableBalance() {
		return disableBalance;
	}

	public void setDisableBalance(Long disableBalance) {
		this.disableBalance = disableBalance;
	}

	public Float getTmallUnpaySettleorder() {
		return tmallUnpaySettleorder;
	}

	public void setTmallUnpaySettleorder(Float tmallUnpaySettleorder) {
		this.tmallUnpaySettleorder = tmallUnpaySettleorder;
	}

	public Float getCaiNiaoSettleorder() {
		return caiNiaoSettleorder;
	}

	public void setCaiNiaoSettleorder(Float caiNiaoSettleorder) {
		this.caiNiaoSettleorder = caiNiaoSettleorder;
	}

	public String getCaiNiaoSettleorderDetail() {
		return caiNiaoSettleorderDetail;
	}

	public void setCaiNiaoSettleorderDetail(String caiNiaoSettleorderDetail) {
		this.caiNiaoSettleorderDetail = caiNiaoSettleorderDetail;
	}

	public String getTmallUnpaySettleorderDetail() {
		return tmallUnpaySettleorderDetail;
	}

	public void setTmallUnpaySettleorderDetail(String tmallUnpaySettleorderDetail) {
		this.tmallUnpaySettleorderDetail = tmallUnpaySettleorderDetail;
	}

}
